package com.huajx.tpd;

public class ConverService {
	
	public final static ConverService service=new ConverService();
	
	 /**
     * 将板地址转换为byte
     * @param boardAddress
     */
    public  void board (String boardAddress){
    	String board = strTo16(boardAddress);
    	System.out.println(board);
    }
    
    public static void main(String[] args) {
    	//service.board(38144);
    	String hexString = Integer.toHexString(38144);
    	//byte high4 = (byte) (i & 240) ; //240的二进制 11110000
    	//byte low4 = (byte) (i & 15); // 15的二进制形式 00001111
	}
    
    
    /**
     * 字符串转化成为16进制字符串
     * @param s
     * @return
     */
    public static String strTo16(String s) {
        String str = "";
        for (int i = 0; i < s.length(); i++) {
            int ch = (int) s.charAt(i);
            String s4 = Integer.toHexString(ch);
            str = str + s4;
        }
        return str;
    }

}
